package com.aios.entity.unit;

import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;

public enum ControllerType {

	SWITCHONLY(0,"Switch Only", "スイッチ のみ"), CAMERAONLY(1,"Camera Only", "カメラ のみ"), ROTATECAMERA(2,
			"Rotate Camera", "回る のみ");

	
	private int controllerTypeId;
	private String controllerTypeEn;
	private String controllerTypeJp;

	private ControllerType(int controllerTypeId,String controllerTypeEn, String controllerTypeJp) {
		this.controllerTypeId= controllerTypeId;
		this.controllerTypeEn = controllerTypeEn;
		this.controllerTypeJp = controllerTypeJp;
	}
	public String getControllerTypeEn() {
		return controllerTypeEn;
	}

	public void setControllerTypeEn(String controllerTypeEn) {
		this.controllerTypeEn = controllerTypeEn;
	}

	public String getControllerTypeJp() {
		return controllerTypeJp;
	}

	public void setControllerTypeJp(String controllerTypeJp) {
		this.controllerTypeJp = controllerTypeJp;
	}

	public static List<String> getList(Locale locale) {
		List<String> controllertype = new ArrayList<String>();

		for (ControllerType ct : values()) {
			if (locale.equals(Locale.JAPAN) || locale.equals(Locale.JAPANESE)) {
				controllertype.add(ct.getControllerTypeJp());
			} else {
				controllertype.add(ct.getControllerTypeEn());
			}
		}

		return controllertype;
	}

	public static Map<Integer, String> getMap(Locale locale) {

		Map<Integer, String> map = new TreeMap<Integer, String>();

		for (ControllerType ct: values()) {
			if(locale.equals(Locale.JAPAN) || locale.equals(Locale.JAPANESE)) {
				map.put(ct.controllerTypeId,ct.controllerTypeJp);
			} else {
				map.put(ct.controllerTypeId, ct.controllerTypeEn);
			}
		}

		return map;
	}
	public int getControllerTypeId() {
		return controllerTypeId;
	}

	public void setControllerTypeId(int controllerTypeId) {
		this.controllerTypeId = controllerTypeId;
	}
}
